{% extends "restricted/base.html" %}
{% load nm %}
{% load js %}

{% block head_resources %}
  {{block.super}}
  {% jsinclude "nm" %}
{% endblock %}

{% block content %}

<h1>Debian New Member - AM Profile</h1>

<table class="personinfo">
    <tr><th>First name</th><td>{{person.cn}}</td></tr>
    <tr><th>Middle name</th><td>{{person.mn|default:""}}</td></tr>
    <tr><th>Last name</th><td>{{person.sn|default:""}}</td></tr>
    <tr><th>Email</th><td>{{person.preferred_email}}</td></tr>
    <tr><th>Account name</th><td>{{person.uid|default:"none chosen yet"}}</td></tr>
    <tr><th>OpenPGP fingerprint</th><td>{{person.fpr|fingerprint}}</td></tr>
    <tr><th>Current status</th><td>{{person.status}}</td></tr>
    {% if visitor.is_admin %}
    <tr><th>Person FD comments</th><td>{{person.fd_comment}}</td></tr>
    {% endif %}
</table>

<h2>Change AM details</h2>

<form action="{% url 'restricted_amprofile' key=person.lookup_key %}" method="post">{% csrf_token %}
<table class="personinfo">
    {% for field in form %}
    <tr>
        <th>{{field.label_tag}}</th>
        <td>{{field}} {{field.errors}}</td>
    </tr>
    {% endfor %}
</table>
    <input type="submit" value="Change">
</form>

<h2>Applicants</h2>

<table>
{% for p in processes %}
<tr>
    <td>{{p.started.date}}</td>
    <td>{{p.progress|desc_progress}}</td>
    <td><a href="{{ p.get_absolute_url }}">{{p.person}}</a></td>
    <td>{{p.person.fd_comment}}</td>
</tr>
{% endfor %}
</table>

{% endblock %}

